#include "readenergywidget.h"
#include "ui_readwidget.h"

ReadEnergyWidget::ReadEnergyWidget(MainWindow* m,QWidget *parent) : m_main(m),ReadWidget(parent)
{
    Init_items();
    this->move(5,5);
}

void ReadEnergyWidget::Init_items()
{
    ui->treeWidget->clear();
    QTreeWidgetItem * root1=new QTreeWidgetItem(ui->treeWidget);
    root1->setText(0,"电能量");

    QTreeWidgetItem* root2=new QTreeWidgetItem(ui->treeWidget);
    root2->setText(0,"精确电能量");

    QTreeWidgetItem *current = new QTreeWidgetItem(root1);
    current->setText(0, "当前");




    QTreeWidgetItem* last1=new QTreeWidgetItem(root1);
    last1->setText(0,"上1结算日");

    QTreeWidgetItem* last2=new QTreeWidgetItem(root1);
    last2->setText(0,"上2结算日");

    QTreeWidgetItem* last3=new QTreeWidgetItem(root1);
    last3->setText(0,"上3结算日");

    QTreeWidgetItem* last4=new QTreeWidgetItem(root1);
    last4->setText(0,"上4结算日");

    QTreeWidgetItem* last5=new QTreeWidgetItem(root1);
    last5->setText(0,"上5结算日");

    QTreeWidgetItem* last6=new QTreeWidgetItem(root1);
    last6->setText(0,"上6结算日");

    QTreeWidgetItem* last7=new QTreeWidgetItem(root1);
    last7->setText(0,"上7结算日");

    QTreeWidgetItem* last8=new QTreeWidgetItem(root1);
    last8->setText(0,"上8结算日");

    QTreeWidgetItem* last9=new QTreeWidgetItem(root1);
    last9->setText(0,"上9结算日");

    QTreeWidgetItem* last10=new QTreeWidgetItem(root1);
    last10->setText(0,"上10结算日");

    QTreeWidgetItem* last11=new QTreeWidgetItem(root1);
    last11->setText(0,"上11结算日");

    QTreeWidgetItem* last12=new QTreeWidgetItem(root1);
    last12->setText(0,"上12结算日");

//    QTreeWidgetItem *combActive = new QTreeWidgetItem(current);
//    combActive->setText(0, "组合有功");

//    QStringList tariffs = {"费率1（尖）", "费率2（峰）", "费率3（平）", "费率4（谷）"};
//    for (const QString &t : tariffs) {
//        QTreeWidgetItem *item = new QTreeWidgetItem(combActive);
//        item->setText(0, t);
//    }
}
